package oop6.pet2;

/**
 * @author oldliu
 * @since 1.0
 */
public class Pet {
    protected String name;
    private int age;
    private String sex;
    private int health;
    private int love;

    public Pet(){
        System.out.println("父类的无参构造");
    }
    public Pet(String name, int age, String sex, int health, int love) {
        this.name = name;
        this.age = age;
        this.sex = sex;
        this.health = health;
        this.love = love;
    }

    /**
     * 显示这个宠物的基本信息
     */
    public void print(){
        System.out.println("这只宠物叫"+name);
        System.out.println("今年"+age+"岁了");
        System.out.println("性别是"+sex);
        System.out.println("健康值"+health);
        System.out.println("可爱值"+love);
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public String getSex() {
        return sex;
    }

    public void setSex(String sex) {
        this.sex = sex;
    }

    public int getHealth() {
        return health;
    }

    public void setHealth(int health) {
        this.health = health;
    }

    public int getLove() {
        return love;
    }

    public void setLove(int love) {
        this.love = love;
    }

    @Override
    public String toString() {
        return "这只宠物叫"+name;
    }
}
